package basicelement;

import istar.IElement;
import istar.ITask;
import istar.agent.IstarJadeAgent;
import istar.behaviour.AbstractIstarBehaviour;
import istar.impl.AbstractBasicTask;
import istar.impl.Belief;
import istar.impl.MeansEndLink;
import istar.impl.Task;
import istar.impl.TaskDecompositionLink;
import jade.core.behaviours.Behaviour;

import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;

import com.rapidminer.example.Attribute;
import com.rapidminer.example.Example;

public class CheckStop extends AbstractBasicTask{

	private boolean log = true;
	
	public CheckStop() {
		super("CheckStop"); 
	}

	@Override
	public Behaviour getBehaviour() {
		return new myBehaviour(this);
	}
	
	private class myBehaviour extends AbstractIstarBehaviour{

		private int estimatedTime = 100;
		
		@Override
		public long getEstimatedWaitingTime() {
			return estimatedTime;
		}

		public myBehaviour(AbstractBasicTask _task){
			super(_task);
		}

		
		@Override
		public void myAction() {
			
			try {
				System.out.println(myAgent.getLocalName() +  " >>>> Starting CheckStop");
				log("Starting CheckStop");
			} catch (Exception e) {
				e.printStackTrace();
			}
			
		}
		
		
		
		private boolean checkStopGain(){
			return false;
			
		}

		private boolean checkStopLoss(){
			return false;
			
		}

		
		@Override
		public int myOnEnd() {
			// TODO Auto-generated method stub
			return 1;
		}

		@Override
		public boolean done() {
			return true;
		}

	}
	
}
